package cn.edu.yzu.scholarship.pojo;

import java.util.List;

import com.jfinal.plugin.activerecord.Page;

public class Pager<T> {
	
	private List<T> rows;
	private int total;
	
	public Pager(List<T> rows, int total) {
		this.rows = rows;
		this.total = total;
	}
	
	/**
	 * 将jfinal的分页实体转换成EASYUI接受的实体。
	 * @param page
	 * @return
	 */
	public static <T> Pager<T> toPager(Page<T> page) {
		return new Pager<T>(page.getList(),page.getTotalRow());
	}
	
	public List<T> getRows() {
		return rows;
	}
	public void setRows(List<T> rows) {
		this.rows = rows;
	}
	public int getTotal() {
		return total;
	}
	public void setTotal(int total) {
		this.total = total;
	}
}
